<?php
// 调用OpenAPI的例子
// 这个程序必须运行在雅虎关系开放平台的框架下

include ("./YKOpenApi.class.php");
//  include ('./jsonwrapper/jsonwrapper.php'); 如果没有json扩展，则包含此文件

$user_id = "03000183946";
$api_key = '{YOURAPI_KEY}';  //替换为你的API KEY
$secret_key = "{YOURSECRET_KEY"; //替换为你的SECRET KEY
$client = new YkOpenApi($api_key, $secret_key);
$params=array(
        "v"=>"1.0",
        "user_id"=>$user_id
    );
$abc = $client->users("getInfo", array ('uids'=>$user_id)); //调用users.getInfo API, 如果希望返回结果为json格式，提供第三个参数为 "json"
var_dump ($abc);
/* 返回的结果
string(1235) "<?xml version="1.0" encoding="utf-8"?> 
<users_getInfo_response xmlns="http://api.my.cn.yahoo.com/1.0/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://api.my.cn.yahoo.com/1.0/ http://api.my.cn.yahoo.com/1.0/yk.xsd" list="true"> 
  <user>
    <uid>03000183946</uid>
    <name>徐景</name>
    <sex>1</sex>
    <birthday>1982-05-26</birthday>
    <tinyurl>
		http://s.timgs.cn:80/ylem/get?version=1.0&enc=AKqQyrzjiG7uk6ylr3VVhTk6vgUeO5mumDHsGWWm_FQIGPN5.K5hcH_JqnMw4PA5I4p9.ZlwdyJW6bMv8qM3li4OChAUkHUy7uwdbQo32OKWb_KM2UYtA_J1w93yImUHY9s6eLOtjYc1hQc-
    </tinyurl>
    <headurl>
		http://s.timgs.cn:80/ylem/get?version=1.0&enc=AKqQyrzjiG7uk6ylr3VVhTk6vgUeO5mumDHsGWWm_FQIGPN5.K5hcH_JqnMw4PA5I4p9.ZlwdyJW6bMv8qM3li4OChAUkHUy7uwdbQo32OKWb_KM2UYtA_J1w93yImUHY9s6eLOtjYc1hQc-
	</headurl>
    <mainurl>
		http://s.timgs.cn:80/ylem/get?version=1.0&enc=xJU4UD7jiG534I0oenW8mGy8oJRWCGUz9YZaH7oDAraEJD7rs1YAJzr9lvfrrApZsiEuuhIb4lL90Qu3uKU8.GVGua8GrJCstmiNBFWfAOhfJgHaGG.XnG6WLJ4utxM1538xfKuY2zlzD6Q-
    </mainurl>
    <hometown_location>
      <city>北京</city>
    </hometown_location>
  </user>
</users_getInfo_response><!-- openfe01.sns.cnb.yahoo.com uncompressed/chunked Thu Mar 12 09:48:40 CST 2009 -->
"
*/
?>
